home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
ARMLINUX
/
ISCAFS
/
PATCH-0-04
< prev
Wrap
Text File
|
1998-04-05
|
6KB
|
158 lines
Okey-dokey, here's the discname reading patch.
You were saving some registers that I simply wasn't using in
Image_IdentifyDisc, so I changed it.
I'm not entirely sure why you decided to go for signed arithmetic rather
than unsigned - surely a length is not a negative quantity?
diff -urN Dev.Base.b.Workspace !IscaFS.b.Workspace
--- Dev.Base.b.Workspace Sat Mar 28 13:24:06 1998
+++ !IscaFS.b.Workspace Wed Apr 01 19:25:34 1998
@@ -30,7 +30,7 @@
ENDIF
REM The MAlloc vectors are added after the main workspace is stored, so
-REM lwn_workspace% is NOT the real length which will be allocted to the
+REM len_workspace% is NOT the real length which will be allocated to the
REM workspace.
malloc_tabbase% = len_workspace%
malloc_claim% = malloc_tabbase%+0
@@ -81,34 +81,46 @@
REM superblock structure (inside image descriptor structure)
superblock% = 40
s_inodes_count% = superblock%
-s_blocks_count% = superblock%+4
-s_r_blocks_count% = superblock%+8
-s_free_blocks_count% = superblock%+12
-s_free_inodes_count% = superblock%+16
-s_first_data_block% = superblock%+20
-s_log_block_size% = superblock%+24
-s_log_frag_size% = superblock%+28
-s_blocks_per_group% = superblock%+32
-s_frags_per_group% = superblock%+36
-s_inodes_per_group% = superblock%+40
-s_mtime% = superblock%+44
-s_wtime% = superblock%+48
-s_mnt_count% = superblock%+52
-s_max_mnt_count% = superblock%+54
-s_magic% = superblock%+56
-s_state% = superblock%+58
-s_errors% = superblock%+60
-s_minor_rev_level% = superblock%+62
-s_lastcheck% = superblock%+64
-s_checkinterval% = superblock%+68
-s_creator_os% = superblock%+72
-s_rev_level% = superblock%+76
+s_blocks_count% = s_inodes_count%+4
+s_r_blocks_count% = s_blocks_count%+4
+s_free_blocks_count% = s_r_blocks_count%+4
+s_free_inodes_count% = s_free_blocks_count%+4
+s_first_data_block% = s_free_inodes_count%+4
+s_log_block_size% = s_first_data_block%+4
+s_log_frag_size% = s_log_block_size%+4
+s_blocks_per_group% = s_log_frag_size%+4
+s_frags_per_group% = s_blocks_per_group%+4
+s_inodes_per_group% = s_frags_per_group%+4
+s_mtime% = s_inodes_per_group%+4
+s_wtime% = s_mtime%+4
+s_mnt_count% = s_wtime%+4
+s_max_mnt_count% = s_mnt_count%+2
+s_magic% = s_max_mnt_count%+2
+s_state% = s_magic%+2
+s_errors% = s_state%+2
+s_minor_rev_level% = s_errors%+2
+s_lastcheck% = s_minor_rev_level%+2
+s_checkinterval% = s_lastcheck%+4
+s_creator_os% = s_checkinterval%+4
+s_rev_level% = s_creator_os%+4
+s_def_resuid% = s_rev_level%+4
+s_def_resgid% = s_def_resuid%+2
+s_first_ino% = s_def_resgid%+2
+s_inode_size% = s_first_ino%+4
+s_block_group_nr% = s_inode_size%+2
+s_feature_compat% = s_block_group_nr%+2
+s_feature_incompat% = s_feature_compat%+4
+s_feature_ro_compat% = s_feature_incompat%+4
+s_uuid% = s_feature_ro_compat%+4
+s_volume_name% = s_uuid%+16
+s_last_mounted% = s_volume_name%+16
+s_reserved% = s_last_mounted%+64
REM end of superblock structure
REM Note: len_superblock% is not the actual length of a superblock, but the
REM length of it that should be read into the block.
-len_superblock% = s_rev_level%+4-superblock%
+len_superblock% = s_reserved%+4-superblock%
-len_mount% = s_rev_level%+4
+len_mount% = s_reserved%+4
@@ -139,8 +151,8 @@
REM image flags
-mntflag_size2% = 1 :REM set if blocks are 2k long
-mntflag_size4% = 1<<1 :REM set if blocks are 4k long
+REM mntflag_size2% = 1 :REM set if blocks are 2k long
+REM mntflag_size4% = 1<<1 :REM set if blocks are 4k long
mntflag_partition% = 1<<2 :REM set if it's a partition (not an image)
diff -urN Dev.Base.s.Image !IscaFS.s.Image
--- Dev.Base.s.Image Sat Mar 28 16:42:22 1998
+++ !IscaFS.s.Image Wed Apr 01 19:21:16 1998
@@ -213,13 +213,9 @@
; r6 = new sector cache handle
; AORP
;------------------------
- FNfunction("r0-r5,r7")
-;P This is MW's version of this function (which does things properly)
-;P Errr... well, that's what I thought. Actually, this was corrupting
-;P registers, and since it's a Service call, not a filesystem entry point,
-;P that's a Bad Thing (TM).
+ FNfunction("r2-r4,r7")
;------------------------
-; for now, don't worry about sequence sides, shapes etc
+; an ext2 floppy might have almost any shape. Let's believe Filecore.
;------------------------
; try to recognise the disc from the special word in the first super block
MOV r1,#9+(1<<6) ; read sectors via cache, ignore esc
@@ -226,8 +222,8 @@
ORR r1,r1,r5,LSL #6
MOV r4,#s_magic%+4
CMP r3, #5
- MOVLE r7, #0
- MOVGT r7, r2
+ MOVLO r7, #0
+ MOVHS r7, r2
LDR r2,[r5,#&c] ; disc address of root directory
MOV r2,r2,LSL #28
ADD r2,r2,#1024 ; disc address
@@ -240,6 +236,7 @@
MOV r2, r2, LSL #16 ;M
EOR r2, r2, #&ef000000
TEQ r2, #&00530000
+ MOVNE r1, #&69
FNcreturn("NE")
;------------------------
; it is an ext2 disc - return the right info and update the disc shape
@@ -248,6 +245,18 @@
ADD r2, r2, #10 ;M
MOV r1, r1, LSL r2
STR r1,[r5,#16] ; disc_size
+ ADD r4, r4, #s_volume_name%-superblock%
+ LDMIA r4, {r1-r3} ; get first 12 bytes of name
+ MOV r3, r3, LSL #16 ; drop last 2 characters
+ ORR r3, r3, r2, LSR #16 ; and put the two from r2 in
+ MOV r2, r2, LSL #16 ; drop last 2 characters
+ ORR r2, r2, r1, LSR #16 ; and put the two from r2 in
+ MOV r1, r1, LSL #16 ; put the first two chars at the top
+ LDR r14, [r4, #s_volume_name%-s_wtime%]
+ MOV r14, r14, LSL #16 ; put the lsb at the top..
+ ORR r1, r1, r14, LSR #16 ; and then ORR it into the bottom.
+ ADD r4, r5, #20
+ STMIA r4, {r1-r3} ; set up the name & cycle ID
TEQ r7, #0
BEQ _no_space_for_formatname
LDR r2, _ext2_word